<template>
<view>
  <view class="vuyaa" v-for="item in datalist">
     <view class="lefpng">
        <image src="https://ayh.wissun.net/static/ayh/aa6.png"  />
     </view>
     <view class="ritxt">
        <view class="titlepdd">
          <view>  {{item.remark}} </view>
          <view class="tuu" >
            <view class="priced" v-if="item.source_type==1">+{{item.integral}}积分</view>
			<view class="priced" v-if="item.source_type==2">-{{item.integral}}积分</view>
          </view>
        </view>
        <view class="addtime">{{item.create_time}}</view>
     </view>
  </view>
  <view class="nodata" v-if="datalist.length == 0">暂无任何记录</view>
</view>
</template>

<script>
	export default {
		data() {
			return {
				datalist:[],
				page:1,
				tabindex:1,
				page_size:10
			}
		},
		onShow() {
			this.getdata()
		},
		onPullDownRefresh(){
			this.getdata()
		},
		 onReachBottom: function () {
			 this.getdata()
		},
		methods: {
			 getdata(){
				 var postdata={}
				 var that=this;
				 postdata.user_id=uni.getStorageSync('fahuo_username').id
				 this.request('/api/integral_shop_front/get_user_integral_log2', postdata,"post").then(data => {
				 	that.datalist=data.info.datalist
				 })
			},
			 //兑换再来一罐
			duihuan_by_one(item){
			  var id=item.id
			  var trace_code=item.sncode
			  var product_code=item.goods_no
			  var that=this;
			  uni.redirectTo({
				url: '/pages/index/againbyone?id='+id+"&sncode="+trace_code+"&product_code="+product_code
			  })
			}
		}
	}
</script>

<style>
	.lefpng{
	  width: 50px;
	  height: 50px;
	}
	.lefpng image{
	  width: 100%;
	  height: 100%;
	  border-radius: 5px;
	}
	.vvadd{
		background-color: #009688;
		color: #fff;
		padding: 4px 12px;
		border-radius: 6px;
	}
	.titlepdd{
	  display: flex;
	  justify-content: space-between;
	  
	}
	.vuyaa{
	  display: flex;
	  margin: 28px 20px;
	}
	.addtime{
	  color: #999;
	  margin-top: 10px;
	}
	.nodata{
	  text-align: center;
	  margin-top: 150px;
	  color: #999;
	}
	.ritxt{
	  margin-left: 10px;
	  font-size: 14px;
	  width: calc(100% - 60px);
	}
	.tyrr{
	  font-size: 12px;
	  position: relative;
	  top: 3px;
	}
	.tuu{
	  display: flex;
	  position: relative;
	  top: 12px;
	}
	.priced{
	  font-size: 15px;
	  font-weight: bold;
	  color: red;
	}
</style>